<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>医师核查患者</title>
    <link rel="stylesheet" type="text/css" href="../css/api.css" />
    <link rel="stylesheet" type="text/css" href="../css/style.css" />
    <link rel="stylesheet" type="text/css" href="../css/aui.2.0.css" />
    <style>
      .hospital > div{
        width: 100%;
        height: 40px;
        margin-top: 5px;
      }
      .hospital > div:nth-of-type(odd){
        background-color: #ddd;
      }
      .hospital > div:nth-of-type(even){
        background-color: #8bcdfb;
      }
      .hospital > div > span{
        padding-left: 5px;
        display: inline-block;
        height: 40px;
        line-height: 40px;
      }
      .aui-list-item-inner > div{
        display: -webkit-flex;
        display: flex;
        justify-content: space-around;
        align-items: center;
        width: 100%;
      }
      .aui-list-item-inner > div >span:nth-child(1){
        text-align: left;
        padding-left: 10px;
        -webkit-box-sizing: border-box;
        -moz-box-sizing: border-box;
        -ms-box-sizing: border-box;
        -o-box-sizing: border-box;
        box-sizing: border-box;
      }
      .aui-list-item-inner > div >span:nth-child(1){
        flex: 0.3;
      }
      .aui-list-item-inner > div >span{
        flex: 1;
        text-align: center;
        font-size: 14px;
      }
      .aui-list-item-inner > div >span:nth-child(2),.aui-list-item-inner > div >span:nth-child(3){
        flex: 0.7;
      }
      .aui-list-item-inner > div >span:nth-child(4){
        flex: 0.6 !important;
      }
      .aui-list-item-inner > div >span:nth-child(2){
        display: inline-block;
        background-image: url('../image/nickname.png');
        width: 100px;
        height: 40px;
        background-repeat: no-repeat;
        background-position: 10px 5px;
        background-size: 20px 20px;
        line-height: 40px;
        text-align: left;
        padding-left: 40px;
      }
      .aui-list-item-inner > div >span:nth-child(4){
        display: inline-block;
        width: 100px;
        height: 40px;
        background-repeat: no-repeat;
        background-position: 25px 5px;
        background-size: 25px 25px;
        line-height: 40px;
      }
      .aui-btn-info,.aui-btn-danger{
        width: 60px;
        height: 30px;
        text-align: center;
        line-height: 10px;
        padding: 10px 10px 13px 10px !important;
      }
      .aui-iconfont{
        font-size: 14px;
      }
      .aui-btn-danger{
        background-color: #d4237a !important;
      }
      .aui-content ul li:nth-of-type(odd){ background:#f0f0f0;}
    </style>
</head>

<body>
    <section class="hospital">
      <div class="aui-content aui-margin-b-15">
        <ul class="aui-list aui-form-list" >
            <li class="aui-list-item aui-list-item-form">
                <div class="aui-list-item-inner">
                  <div class="aui-list-item-label">
                      <span style="color: #23b7e5;">序号</span>
                  </div>
                    <div class="aui-list-item-label">
                        <span style="color: #23b7e5;">姓名</span>
                    </div>
                    <div class="aui-list-item-label">
                        <span style="color: #23b7e5;">性别</span>
                    </div>
                    <div class="aui-list-item-label">
                        <span style="color: #23b7e5;">年龄</span>
                    </div>
                    <div class="aui-list-item-label">
                        <span style="color: #23b7e5;">患者来源</span>
                    </div>
                    <div class="aui-list-item-label">
                        <span style="color: #23b7e5;">已治疗次数</span>
                    </div>
                </div>
            </li>
        </ul>
        <ul class="aui-list aui-form-list" v-for="(itme, index) in CabinInformation" v-if="itme.F_paientname">
            <li class="aui-list-item aui-list-item-form">
                <div class="aui-list-item-inner">
                    <div class="aui-list-item-label">
                        {{index+1}}
                    </div>
                    <div class="aui-list-item-label">
                        {{itme.F_paientname}}
                    </div>
                    <div class="aui-list-item-label">
                        {{itme.F_patientsex}}
                    </div>
                    <div class="aui-list-item-label">
                        {{itme.F_patientage}}
                    </div>
                    <div class="aui-list-item-label">
                        {{itme.F_patientsourse}}
                    </div>
                    <div class="aui-list-item-label">
                        {{itme.F_zhiliaonumber}}
                    </div>
                </div>
            </li>
        </ul>
        <div>
              <p>请选择核查医师：</p>
                <select id="F_ysName" style="padding-left:30px;">
                  <template  v-for="(F_ysName, index) in Query_UserList"  v-if="F_ysName.Permissions_Name == '医师'">
                  <option  :value="F_ysName.User_Name">{{F_ysName.User_Name}}</option>
                  </template>
                </select>
        </div>
        <p class="add-cabin-info">
            <div class="aui-bar aui-bar-btn aui-bar-btn-round aui-btn-sm" style="width:45%;padding:20px 0px;">
                <div class="aui-bar-btn-item aui-active" onclick="Update_CabinInformation(1)">核检通过</div>
                <div class="aui-bar-btn-item" onclick="Update_CabinInformation(2)">核检未通过</div>
            </div>
        </p>
      </div>
    </section>
</body>
</html>

<script src="../script/api.js" charset="utf-8"></script>
<script src="../script/vue.js" charset="utf-8"></script>
<script src="../js/ToConfigure.js" charset="utf-8"></script>
<script src="../script/aui-toast.js" charset="utf-8"></script>
<script type="text/javascript">
var vm = null;
  apiready = function () {

    vm = new Vue({
      el: '.hospital',
      data: {
        manIcon: {
          backgroundImage: "url(../image/sex_man.png)"
        },
        womanIcon: {
          backgroundImage: "url(../image/sex_woman.png)"
        },
        CabinInformation: [],
        Query_UserList: [],
        Url_IP: "",
        ID: 0
      },
      created(){
        //获取所属医院IP地址
        this.Url_IP = ToConfigure_IP("Gorgeous");
        //获取舱次Id 通过舱次Id获取舱次人员
        this.ID = api.pageParam.F_id;
        if (this.ID > 0) {
            this.Query_HO_HatchLocation(this.ID);
        }
        //获取操作人员信息
        api.ajax({
            url: this.Url_IP + 'HyperbaricOxygen/CabinTreatment/Query_UserList',
            method: 'get',
            data: {
                values: {}
            }
        }, function(ret, err) {
            if (ret) {
                //舱室操舱人员信息
                vm.Query_UserList = ret;
            } else {
                var toast = new auiToast();
                toast.fail({
                    title: "暂无舱次信息",
                    duration: 2000
                });
            }
        });
      },
      methods: {
        //查询舱次人员以及座位
        Query_HO_HatchLocation: function(ID) {
            //判断舱次Id不等于空
            if (ID > 0 && ID != undefined) {
                api.ajax({
                    url: this.Url_IP + 'HyperbaricOxygen/CabinTreatment/Query_HO_HatchLocation',
                    data: {
                        values: {
                            ID: ID
                        }
                    },
                    method: 'get',
                }, function(ret, err) {
                    if (ret) {
                        vm.CabinInformation = ret;
                    } else {
                        alert(JSON.stringify(err));
                    }
                });
            }
        }
      }
    })
  }
  function Update_CabinInformation(CabinState){
    var Query_JsParms = new Object();
    Query_JsParms.F_id = api.pageParam.F_id;
    Query_JsParms.F_CabinState = CabinState;
    Query_JsParms.F_CabinStateName = document.getElementById("F_ysName").value;
    Query_JsParms.F_RemindInspect = "2";
    var JsonStr = JSON.stringify(Query_JsParms);
    var Url_IP  = ToConfigure_IP("Gorgeous");
    api.ajax({
        url: Url_IP + 'HyperbaricOxygen/CabinTreatment/Update_HO_CabinInformation',
        method: 'POST',
        data: {
            values: {
                parms: JsonStr
            }
        },
        dataType: 'String',
    }, function(ret, err) {
        var toast = new auiToast();
        if (ret == "True") {
            toast.success({
                title: "核查成功",
                duration: 2000
            });
        } else {
            toast.fail({
                title: "核查失败",
                duration: 2000
            });
        }
    });
  }

</script>
